<?php 

/**
* 上传类
*/
class Upload
{

	/*
	*配置
	*/
	public $config= array(
		'UPLOAD_PATH'=>'./Img/',
		'UPLOAD_NAME'=>'uniqid',
		'UPLOAD_TYPE'=>'jpg,png,gif',
		'UPLOAD_MAX_FILE_SIZE'=>'5000000',
		);

	/*
	*构建方法初始化
	*/
	public function __construct($config=array())
	{
		foreach ($this->config as $key => $value) {
			$this->config[$key] = isset($config[$key]) ? $config[$key] : (C($key) ? C($key) : $this->config[$key]);
		 } 

	}

	/*
	*上传保存
	*/
	public function Save()
	{

		// 获取文件上传数据
		$FileList = current($_FILES);

		// 重组数据
		$FileList = $this->_reform($FileList);

		//检测数据是否条例要求
		$this->_check($FileList);

		//移动文件
		return $this->_move($FileList);
		
	}


	/*
	*重组数据
	*/
	private  function _reform($FileList)
	{


		return '';
	}


	/*
	*检测数据
	*/
	private  function _check($FileList)
	{
		echo 'fsdfsdfsdfsdf';
		exit;
	}


	/*
	*移动文件
	*/
	private  function _move()
	{

		return '';
		
	}


}
















 ?>